from django import template
import math
register = template.Library()

def barstyle(value , args):
	return  120 -int( 90 * math.log10(value+1) / math.log10(float(args)))



def rankpercent(value):
	args = 830499
	return int(math.ceil(value * 100/args) + 1)
register.filter('barstyle' , barstyle)
register.filter('rankpercent' , rankpercent)


